package com.ruoyi.process.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.process.mapper.WorkFertilizMapper;
import com.ruoyi.process.domain.WorkFertiliz;
import com.ruoyi.process.service.IWorkFertilizService;

/**
 * 施肥管理Service业务层处理
 *
 * @author ruoyi
 * @date 2021-07-12
 */
@Service
public class WorkFertilizServiceImpl implements IWorkFertilizService
{
    @Autowired
    private WorkFertilizMapper workFertilizMapper;


    @Override
    public List<WorkFertiliz> selectWorkFertilizByuserId(Long userId) {
        return workFertilizMapper.selectWorkFertilizByuserId(userId);
    }

    /**
     * 查询施肥管理
     *
     * @param workFertilizeId 施肥管理ID
     * @return 施肥管理
     */
    @Override
    public WorkFertiliz selectWorkFertilizById(Long workFertilizeId)
    {
        return workFertilizMapper.selectWorkFertilizById(workFertilizeId);
    }

    /**
     * 查询施肥管理列表
     *
     * @param workFertiliz 施肥管理
     * @return 施肥管理
     */
    @Override
    public List<WorkFertiliz> selectWorkFertilizList(WorkFertiliz workFertiliz)
    {
        return workFertilizMapper.selectWorkFertilizList(workFertiliz);
    }

    /**
     * 新增施肥管理
     *
     * @param workFertiliz 施肥管理
     * @return 结果
     */
    @Override
    public int insertWorkFertiliz(WorkFertiliz workFertiliz)
    {
        workFertiliz.setCreateTime(DateUtils.getNowDate());
        return workFertilizMapper.insertWorkFertiliz(workFertiliz);
    }

    /**
     * 修改施肥管理
     *
     * @param workFertiliz 施肥管理
     * @return 结果
     */
    @Override
    public int updateWorkFertiliz(WorkFertiliz workFertiliz)
    {
        workFertiliz.setUpdateTime(DateUtils.getNowDate());
        return workFertilizMapper.updateWorkFertiliz(workFertiliz);
    }

    /**
     * 批量删除施肥管理
     *
     * @param workFertilizeIds 需要删除的施肥管理ID
     * @return 结果
     */
    @Override
    public int deleteWorkFertilizByIds(Long[] workFertilizeIds)
    {
        return workFertilizMapper.deleteWorkFertilizByIds(workFertilizeIds);
    }

    /**
     * 删除施肥管理信息
     *
     * @param workFertilizeId 施肥管理ID
     * @return 结果
     */
    @Override
    public int deleteWorkFertilizById(Long workFertilizeId)
    {
        return workFertilizMapper.deleteWorkFertilizById(workFertilizeId);
    }
}
